<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

Route::prefix('')->group(function() {
    Route::post('user/login', [\App\Http\Controllers\Api\UserController::class, 'login']);
    Route::post('user/auth', [\App\Http\Controllers\Api\UserController::class, 'auth']);
    Route::post('task/upload', [\App\Http\Controllers\Api\TaskController::class, 'upload']);
});

Route::middleware('mini')->prefix('')->group(function() {
    Route::get('task/lists', [\App\Http\Controllers\Api\TaskController::class, 'lists']);
    Route::post('task/modify', [\App\Http\Controllers\Api\TaskController::class, 'modify']);
    Route::post('task/delete', [\App\Http\Controllers\Api\TaskController::class, 'delete']);
    Route::post('task/add', [\App\Http\Controllers\Api\TaskController::class, 'add']);
});
